#include "IntegerSet.h"
#include <iostream>
#include <cstdlib>
using namespace std;

int main(int argc, const char *argv[])
{
    IntegerSet a;
    IntegerSet b;

    while (1)
    {
       cout << "Enter an element (input a non-number to end):";
       cin >> a;
       if (!cin)
       {
           cin.clear ();
           cin.ignore ();
           cout << "Entry complete\n"
                   "Set A is now:\n";
           cout << a << endl << endl;
           break;
       }
    }

    while (1)
    {
       cout << "Enter an element (input a non-number to end):";
       cin >> b;
       if (!cin)
       {
           cin.clear ();
           cin.ignore ();
           cout << "Entry complete\n"
                   "Set B is now:\n";
           cout << b << endl << endl;
           break;
       }
    }

    cout << "\nUnion of A and B is:\n";
    cout << (a | b);
    cout << "\nIntersection of A and B is:\n";
    cout << (a & b);
    cout << "\nSet A is" << (a == b ? "" : " not") << " euqal to set B";
    cout << endl;

    cout << "\nInserting 77 into set A ...\n"
            "Set A is now:\n";
    cout << (a << 77) << endl;

    cout << "\nDeleting 77 from set A...\n"
            "Set A is now:\n";
    a.deleteElement (77);
    cout << a << endl;

    return 0;
}
